/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-11-26
 * Time:9:40
 */
class Arr2<T> {
    //数组
    public T[] arr = (T[]) new Object[10];
    //获取数据
    public T getPos(int pos) {
        return arr[pos];
    }
    //设置某位置上的数据
    public void setVal(int pos,T val){
        this.arr[pos] = val;
    }
}
public class test2 {
    public static void main(String[] args) {
        Arr2<Integer> arr2 = new Arr2<>();
        arr2.setVal(0,10);
        Integer ret = arr2.getPos(0);
        System.out.println(ret);

        Arr arr3 = new Arr();
        arr3.setVal(0,1);
        Integer ret3 = (Integer) arr3.getPos(0);
    }

}
